package com.example.wenliangjiudian.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CustomerInRoomLogDO implements Serializable {

    private String customerName;
    private String roomNum;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    private Date inTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date outTime;
    private Integer sex;
    private String idcard;
    private String phone;
    private String typeName;
    private Integer price;

    private String inTimeStr;
    private String outTimeStr;

    public String getInTimeStr() {
        if (inTime == null) {
            return null;
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(inTime);
    }

    public void setInTimeStr(String inTimeStr) {
        this.inTimeStr = inTimeStr;
    }

    public String getOutTimeStr() {
        if (outTime == null) {
            return null;
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(outTime);
    }

    public void setOutTimeStr(String outTimeStr) {
        this.outTimeStr = outTimeStr;
    }
}
